import java.util.SortedMap;

public interface DBInterface{
	
	public String getNumberOfNextPicSegment(String peerName);
	
	public String[] findPeersThatHavePeerInPicSet(String peerName);
	
	public float findProbabiltyForPictureUpdate(String peerName);
	
	public int findHowManyPeersHaveNewPic(String peerName);
	
	//return all tuples in DB
	public SortedMap<String, DBTuple> getAllTuples();
	
	 //return all tuples in DB that are OnLine
	public  SortedMap<String, DBTuple> getAllTuplesForUpdate();
	
	/**
	 * @param PeerName - peer to start from
	 * @return all tuples in DB from the peerName parameter and further
	 */
	public  SortedMap<String, DBTuple> getTuplesFromPeer(String peerName);
	
	/**
	 * @param PeerName - peer to end with
	 * @return all tuples in DB until the peerName parameter
	 */
	public  SortedMap<String, DBTuple> getTuplesUntilPeer(String peerName);
	
	/**
	 * @param Peer1 - peer to start from
	 * @param Peer2 - peer to end with
	 * @return all tuples in DB from the peerName parameter and further
	 */
	

	public  SortedMap<String, DBTuple> getRangeOfPeers(String peer1, String peer2, String dbVersion);
	
	/**
	 * this function takes all the tuples with a DB Version earlier then the given parameter
	 * @param dbVersion - the version to check
	 * @return all the appropriate tuples
	 */
	public  SortedMap<String, DBTuple> getTuplesByDbVersion(String dbVersion);
	
	/**
	 * 
	 * @return all the tuples in the DB - in TEXT
	 */
	public String asString();
	public  boolean isDBEmpty();
	
	// return the DB Tuple of the peer
	public  DBTuple findTuple(String PeerName);
}
